<template>
  <div id="app" :style="{height:'100%'}">
    <div class="main" :style="{height: '100%'}">
      <router-view></router-view>
    </div>
    
   <footerNav :showNav='showNav'></footerNav>
  </div>
</template>

<script>
import footerNav from './components/home/footerNav'
export default {
  name: 'App',
  data(){
    return {
      direction:'forward',
      showNav:true
    }
  },
  components:{
    footerNav
  },
  watch:{
     // 如果路由有变化，会执行该方法
    '$router':function(){
      this.routerChange()
    }
  },
  methods:{
    routerChange(){
      let path=this.$router.path
      if(path==='./'||path==='./cinema'||path==='./me'){
        this.showNav=true
      }else{
        this.showNav=false
      }
    }
  },
  created () {
    // this.routeChange()
  },
  mounted () {
    window.setTimeout(() => {
      document.documentElement.scrollTop = 0
      document.body.scrollTop = 0
    }, 250)
  }
}
</script>

<style>
 body {
    background: #f5f5f5;
  }
</style>
